{include file="common/pc/header" title="账号信息修改" /}

<form class="layui-form" action="" method="post" enctype="multipart/form-data">
    <div class="layui-form-item">
        <label class="layui-form-label">开启回调：</label>
        <div class="layui-input-block">
            {php}
            $checked = $callback['open'] ? "checked":"";
            $style = $callback['open'] ? "":"display:none;";
            {/php}
            <input type="checkbox" name="open" lay-skin="switch" lay-filter="open" lay-text="开启|关闭" {$checked}/>
        </div>
    </div>
    <div id="tags" style="{$style}">
        {foreach name="groups" key="groupName" item="items"}
        <div class="layui-form-item">
            <label class="layui-form-label">{$groupName}</label>
            <div class="layui-input-block">
                {foreach name="items" key="tag" item="tagName"}
                {php}
                $checked = $callback['tags'] && in_array($tag, $callback['tags']) ? "checked":"";
                {/php}
                <input type="checkbox" name="{$tag}" title="{$tagName}" lay-skin="primary" {$checked}/>
                {/foreach}
            </div>
        </div>
        {/foreach}
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="submit"> 保 存</button>
        </div>
    </div>
</form>

<script>
    layui.use('form', function () {
        var form = layui.form;
        form.on('switch(open)', function(data){
            if(data.elem.checked) {
                $("#tags").show();
            } else {
                $("#tags").hide();
            }
        });
    });
</script>

{include file="common/pc/footer"/}